﻿using System;
using System.Collections.Generic;
using System.Text;
using DotNet.Data;
using DotNet.Model;
using System.Data;
namespace DotNet.Business
{
	public class ProductAttributeBll
	{
		ProductAttributeDal pDal=new ProductAttributeDal();

		#region 是否存在该记录
		/// <summary>
		/// 是否存在该记录
		/// </summary>
		public bool Exists(int ProductAttributeID)
		{
			return pDal.Exists(ProductAttributeID);
		}
		#endregion

		#region 获得数据列表
		/// <summary>
		/// 获得数据列表
		/// </summary>
		public IList<ProductAttribute> GetModel()
		{
			return pDal.GetModel();
		}
		#endregion

        #region 根据产品id获得属性数据列表---郑同飞
        /// <summary>
        /// 根据产品id获得属性数据列表---郑同飞
        /// </summary>
        /// <param name="productID"></param>
        /// <returns></returns>
        public DataTable getAllAttribute(int productID) 
        {
            return pDal.getAllAttribute(productID);
        }
        #endregion

        #region 根据标识列获得数据实体
        /// <summary>
		/// 根据标识列获得数据实体
		/// </summary>
		/// <param name="ProductAttributeID">标识列</param>
		/// <returns></returns>
		public ProductAttribute GetModel(int ProductAttributeID)
		{
			return pDal.GetModel(ProductAttributeID);
		}
		#endregion

        #region 根据属性id获得产品属性内容---郑同飞
        /// <summary>
        /// 根据属性id获得产品属性内容---郑同飞
        /// </summary>
        /// <param name="attributeID"></param>
        /// <returns></returns>
        public IList<ProductAttribute> getModelByAttributeID(int attributeID,int productID)
        {
            return pDal.getModelByAttributeID(attributeID,productID);
        }
        #endregion

        #region 根据属性id判断是否存在---郑同飞
        /// <summary>
        /// 根据属性id判断是否存在---郑同飞
        /// </summary>
        /// <param name="attributeID"></param>
        /// <param name="productID"></param>
        /// <returns></returns>
        public bool Exists(int attributeID, int productID)
        {
            return pDal.Exists(attributeID, productID);
        }
        #endregion

        #region 修改信息
        /// <summary>
		/// 修改信息
		/// </summary>
		/// <param name="ProductAttribute">实体</param>
		/// <returns></returns>
		public bool Update(ProductAttribute productattribute)
		{
			 return pDal.Update(productattribute);
		}
		#endregion

		#region 删除信息
		/// <summary>
		/// 删除信息
		/// </summary>
		/// <param name="ProductAttributeID">标识列</param>
		/// <returns></returns>
		public bool Delete(int ProductAttributeID)
		{
			 return pDal.Delete(ProductAttributeID);
		}
		#endregion

		#region 添加信息
		/// <summary>
		/// 添加信息
		/// </summary>
		/// <param name="ProductAttribute">实体</param>
		/// <returns></returns>
		public bool Insert(ProductAttribute productattribute)
		{
			 return pDal.Insert(productattribute);
		}
		#endregion

        #region 产品属性分页---郑同飞
        /// <summary>
        /// 产品属性分页---郑同飞
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="attributeID"></param>
        /// <param name="productID"></param>
        /// <returns></returns>
        public DataTable pagingForProductAttribute(int pageIndex,int pageSize,int attributeID,int productID) 
        {
            return pDal.pagingForProductAttribute(pageIndex, pageSize, attributeID, productID);
        }
        #endregion

        #region 产品属性数量---ztf
        /// <summary>
        /// 产品属性数量---ztf
        /// </summary>
        /// <param name="attributeid"></param>
        /// <param name="productid"></param>
        /// <returns></returns>
        public int getRecordCount(int attributeid,int productid) 
        {
            return pDal.getRecordCount(attributeid, productid);
        }
        #endregion
    }
}
